Skip to content

refactor(client): Todo·Routine 화면 컨텍스트 분리 - #66

Merged
tartelettie merged 44 commits into
mainfrom
refactor/todo-routine-flow
Sep 3, 2026
Merged

tartelettie merged 44 commits into
mainfrom
refactor/todo-routine-flow

Conversation

@tartelettie

@tartelettie tartelettie commented Aug 27, 2026 •

Copy link
Copy Markdown
Collaborator

이 PR을 어떻게 봐야 하나

이 PR들은 리뷰를 쉽게 하려고 기능 단위로 쌓아 둔 PR입니다.

지금 GitHub 화면에서 #66/#69/#70은 main으로 바로 merge되는 PR이 아닙니다. 선행 PR 브랜치를 base로 둬서 리뷰어가 "이번 PR에서 추가로 바뀐 부분"만 작게 볼 수 있게 해 둔 상태입니다.

예를 들어 #66 화면에 이렇게 보이면 정상입니다.

refactor/todo-routine-flow → refactor/frontend-context-foundation

이 상태에서 바로 merge하면 main이 아니라 refactor/frontend-context-foundation으로 들어갑니다. 그래서 실제 main merge는 아래 순서로 합니다.

#65를 main에 merge
→ #66 base를 main으로 바꾼 뒤 merge
→ #69 base를 main으로 바꾼 뒤 merge
→ #70 base를 main으로 바꾼 뒤 merge

즉 리뷰할 때는 지금처럼 stacked PR로 작게 보고, merge할 때만 다음 PR의 base를 main으로 바꿔서 순서대로 넣습니다.


왜

Todo/Routine 화면 로직이 Screens.tsx와 useAppData.ts에 섞여 있었습니다. 리뷰 기준은 기능별 폴더가 자기 화면, hook, domain 규칙을 소유하는 구조입니다.

이 PR은 todo/routine 범위만 분리해서 후속 notes/time PR과 변경 범위를 섞지 않도록 합니다.

무엇을 했나

  • TodoScreen, TodoItem, TodoCalendar를 client/src/todo/components/로 분리했습니다.
  • Todo 상태와 handler를 제공하는 hook 이름을 React 관습에 맞춰 useTodos로 정리했습니다.
  • RoutineEditor를 client/src/routines/components/로 분리했습니다.
  • Routine 상태와 handler를 제공하는 hook 이름을 useRoutines로 정리했습니다.
  • TodoScreen/TodoItem/RoutineEditor는 todoActions, routineActions 같은 묶음 객체 대신 todos, today, onAddTodo, onPatchRoutine 같은 명시적 props를 받게 했습니다.
  • calendar.ts, todo.ts와 테스트를 client/src/todo/domain/으로 이동했습니다.
  • 공통 카드 UI를 shared/ui/Card.tsx로 분리했습니다.
  • 이동된 domain test가 계속 실행되도록 기존 vitest include 범위를 src/**/domain/**/*.test.ts로 조정했습니다.

어떻게 바뀌었나

  • before: Screens.tsx가 todo 화면, calendar 렌더링, routine editor UI, 여러 handler를 직접 가졌습니다.
  • after: todo 화면은 todo/components, todo 상태/handler 조립은 todo/hooks/useTodos, todo 계산 규칙은 todo/domain이 담당합니다.
  • routine은 현재 별도 domain 규칙이 크지 않아 editor UI와 routines/hooks/useRoutines만 분리했습니다.
  • 화면 컴포넌트는 필요한 props를 명시적으로 받습니다. Actions라는 넓은 이름의 객체 prop은 사용하지 않습니다.
  • 날짜 계산은 todo/domain/calendar.ts로 모으고, 현재 날짜는 hook/호출부에서 주입하는 형태로 유지했습니다.

유지한 내용

  • todo 생성/수정/완료/삭제 동작
  • routine 생성/수정/삭제 동작
  • 기존 정렬, 기본 마감일, 완료 전파 규칙
  • API 요청 방식과 저장 DTO
  • useAppData의 workspace data, cache, loading, request helper 소유권
  • 기존 UI 흐름과 문구

일부러 제외한 내용

  • notes/time 리팩토링
  • workspace/cache/loading/request 소유권 분리
  • line limit, e2e/smoke test, 새 임의 CI 정책 추가
  • AGENTS.md 변경

검증

  • cd client && npm test -- --run
  • cd client && npm run typecheck
  • cd client && npm run format:check

@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
todo Ready Ready Preview Sep 3, 2026 10:49am UTC

@tartelettie
tartelettie force-pushed the refactor/todo-routine-flow branch from 2303f04 to 6cf6e2b Compare August 28, 2026 12:46
@tartelettie
tartelettie changed the base branch from main to refactor/frontend-context-foundation August 28, 2026 12:46

@CheHyeonYeong CheHyeonYeong left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 좋아요

component
ㄴ style
*.tsx
으로 나눠주시면 더 좋을 것 같아요

alignItems: "center",
paddingVertical: 9,
borderRadius: 10,
backgroundColor: "#edf0ed",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REAL 그냥 궁금한건데 님 인공지능 초록색 웰케 좋아해요?

Comment thread client/vitest.config.mts Outdated
test: {
environment: "node",
include: ["src/domain/**/*.test.ts"],
include: ["src/**/domain/**/*.test.ts"],

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

음 domain은 보니까 entity를 만든 것 이고 test는 따로 test로 빼야 할 듯 다음에 이렇게 진행해주세요

Comment on lines +11 to +43
export type TodoInput = {
title: string;
scope: Scope;
parentId?: string | null;
dueDate?: string | null;
category?: string | null;
};

export type UseTodosResult = {
todos: Todo[];
today: Date;
addTodo: (input: TodoInput) => Promise<void>;
addTodoWithDefaultDueDate: (input: Omit<TodoInput, "parentId">) => Promise<void>;
patchTodo: (id: string, patch: Partial<Todo>) => Promise<void>;
deleteTodo: (id: string) => Promise<void>;
toggleTodo: (todo: Todo) => void;
};

export function useTodos({
todos,
setData,
reload,
request,
createId,
}: {
todos: Todo[];
setData: SetWorkspaceData;
reload: ReloadWorkspace;
request: WorkspaceRequest;
createId: CreateId;
}): UseTodosResult {
const today = new Date();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

저희 아에 type이랑 todo 쪽 function 을 분리하는게 좋을 것 같아요

@@ -0,0 +1,93 @@
import { StyleSheet } from "react-native";

export const styles = StyleSheet.create({

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style 을 한 곳에 모와두는 게 좋을 것 같아요

@tartelettie
tartelettie changed the base branch from refactor/frontend-context-foundation to main September 3, 2026 10:40
@tartelettie
tartelettie merged commit bd7987d into main Sep 3, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview — 28a9dec5 Deployed Sep 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants